var sound_node = document.createElement('audio');
sound_node.id = 'chatNoise';
sound_node.src = 'http://www.myinstants.com/media/sounds/nooo.mp3';
sound_node.preload = 'auto'
document.documentElement.appendChild(sound_node);

function checkDOMChange()
{

  var elems = document.getElementsByClassName("chat-subject");
  if (elems.length>0)
  {
    document.getElementById('chatNoise').play();
    alert( "You got CHAT!" );
    // call the function again after 20000 milliseconds
    setTimeout( checkDOMChange, 20000 );

  }
  else
  {
    // call the function again after 2000 milliseconds
    setTimeout( checkDOMChange, 2000 );
	
  }

}
checkDOMChange();